%
%
%
%
function [ r ] = scale_expand_within_0_1( x, n )
r = x;
for i = 1:n
    r = (1.0 - cos(pi * r)) / 2.0;
end % for

i = -1;
while ( i >= n)
    r = acos( 1.0 - 2.0 * r) / pi;
    i = i - 1;
end % while

end % function

